package com.zem.imos.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zem.imos.Entity.Enum.Marriage;
import com.zem.imos.Entity.Enum.Period;
import com.zem.imos.Entity.Params.ParamsPatient;
import com.zem.imos.Entity.Params.ParamsSchedule;
import lombok.Data;

@Data
@TableName("labor_schedule")
public class LaborSchedule {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private Long doctorId;
    private int appointmentNums;
    private Long date;
    private Period period;

    public void setPeriod (Integer flag)
    {
        switch (flag){
            case 0 :
                this.period =Period.Forenoon;
                break; //可选
            case 1 :
                this.period =Period.Afternoon;
                break; //可选
            default :
                this.period =Period.Forenoon;
        }
    }

    public LaborSchedule (ParamsSchedule parmas)
    {
        this.id = parmas.getId();
        this.doctorId = parmas.getDoctorId();
        this.appointmentNums = parmas.getAppointmentNums();
        this.date = parmas.getDate();
        this.setPeriod(parmas.getPeriod());
    }
}
